package com.qiyue.admin.entity.base.group;

import com.qiyue.admin.entity.base.User;
import com.qiyue.orm.jpa.model.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import net.minidev.json.annotate.JsonIgnore;

import javax.persistence.*;

/**
 * Created by y747718944 on 2018/2/7
 */
@Entity
@Table(name = "base_group_leader")
@ApiModel("群组领导")
public class GroupLeader extends BaseEntity {

    @Column( name = "group_id" , length = 16)
    private  Long groupId;



    @Column( name = "description" , length = 32)
    private String description;

    public GroupLeader() {
    }

    public GroupLeader(Long groupId, User user) {
        this.groupId = groupId;
        this.user = user;
    }

    public Long getGroupId() {
        return groupId;
    }

    public void setGroupId(Long groupId) {
        this.groupId = groupId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }


    @ApiModelProperty(value = "多对一的关系")
    private User user;

    @ManyToOne( fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id" )
    @JsonIgnore
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
